import Cookies from 'js-cookie'

const TokenKey = 'hrsaas-ihrm-token'

// 设置时间戳的key名称
const timeKey = 'hrsaas-timestamp-key'

export function getToken() {
  return Cookies.get(TokenKey) //获取本地缓存token
}

export function setToken(token) {
  return Cookies.set(TokenKey, token) // 设置本地缓存token
}

export function removeToken() {
  return Cookies.remove(TokenKey) // 删除本地缓存token
}

export function getTimeStamp() {
  return Cookies.get(timeKey) // 获取本地缓存时间戳
}

export function setTimeStamp() {
  Cookies.set(timeKey, Date.now()) // 设置本地缓存时间戳
}